<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 耗材使用验证器
 */
class Consume extends AdminBase
{
    
    // 验证规则
    protected $rule =   [
        'labid'             => 'require|unique:consume',
        'equipid'           => 'require',     
        'class'             => 'require',
        'describe'          => 'require',
        'sort'              => 'require|number',
    ];

    // 验证提示
    protected $message  =   [
        
        'labid.require'              => '实验室编号不能为空',
        'labid.unique'               => '实验室编号已存在',
        'equipid.require'            => '设备编号不能为空',
        'equipid.unique'             => '设备编号已存在',
        'class.require'              => '使用班级不能为空',
        'describe.require'           => '设备描述不能为空',
        'sort.require'               => '排序值不能为空',
        'sort.number'                => '排序值必须为数字'
    ];

    // 应用场景
    protected $scene = [
        
        'edit' =>  ['labid','equipid','class','descirbe','sort'],
    ];
    
}
